package com.qqtop10.manager.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qqtop10.manager.dao.RebateLinkMapper;
import com.qqtop10.manager.model.PagingArgs;
import com.qqtop10.manager.model.RebateLink;
import com.qqtop10.manager.service.RebateLinkService;

@Service("RebateLinkService")
public class RebateLinkServiceImpl extends BaseService implements RebateLinkService {
	
	@Autowired
	private RebateLinkMapper rebateLinkMapper;
	
	@Override
	public List<RebateLink> all(RebateLink input, PagingArgs pagingArgs) {
		return rebateLinkMapper.all(asMap(input, pagingArgs));
	}
	
	@Override
	public int count(RebateLink input) {
		try {
			return rebateLinkMapper.count(input);
		} catch (Exception e) {
			return 0;
		}
	}
	
	@Override
	public int delete(int id) {
		return rebateLinkMapper.delete(id);
	}

	@Override
	public int update(RebateLink rebateLink) {
		return rebateLinkMapper.update(rebateLink);
	}

	@Override
	public int insert(RebateLink rebateLink) {
		return rebateLinkMapper.insert(rebateLink);
	}

	@Override
	public RebateLink selectById(int id) {
		return rebateLinkMapper.selectById(id);
	}
}
